<span class="glyphicon glyphicon-map-marker" aria-hidden="true">
    <span>系统</span> /
    <span>系统权限</span> /
    <span>管理权限</span>
</span>
<div style="width: 100%;margin-top: 20px;">
    <a name="edit" title="添加" class="btn edit-btn" href="{:url('Admin/UserType/add')}">添加</a>
    <div class="table-responsive">
        <table class="table"  border="1" width="100%" cellpadding="0" cellspacing="0" style="margin: 20px 0px;">
            <tr style="height: 40px;">
                <th width="3%">
                    <input type="checkbox" id="ids" onclick="getCheckbox()" />
                </th>
                <th width="10%">ID</th>
                <th width="20%">权限名称</th>
                <th width="25%">创建时间</th>
                <th width="25%">更新时间</th>
                <th>操作</th>
            </tr>
            {volist name="list" id="vo"}
            <tr>
                <th style="height: 40px;">
                    <input type="checkbox" name="ids[]"
                           onclick="getCheckboxByIds({$vo.id})" id="ids-{$vo.id}" value="{$vo.id}" />
                </th>
                <td>{$vo.id}</td>
                <td style="text-align: center;">{$vo.name}</td>
                <td>{$vo.create_time}</td>
                <td>{$vo.update_time}</td>
                <th>
                    <a name="edit" title="编辑" class="btn edit-btn" href="{:url('Admin/UserType/edit')}?id={$vo.id}">编辑</a>
                    <a name="delete" title="删除" class="btn delete-btn" href="javascript:getDelete({$vo.id})">删除</a>
                </th>
            </tr>
            {/volist}
        </table>
        {$list->render()}
    </div>
</div>
<script type="text/javascript">
    function getDelete(id) {
        layer.confirm('请确认是否删除', {
            icon: 3,btn: ['确认','取消'] //按钮
        }, function(){
            $.ajax({
                type:"POST",
                url:"{:url('Admin/UserType/delete')}",
                data:{id:id},
                success:function (res) {
                    layer.msg(res);
                    if(res == "删除成功"){
                        setTimeout('UserType()',3000);
                    }
                }
            });
        }, function () {
            layer.msg('取消操作');
        });
    }
    function UserType() {
        window.location.href = window.location.href;
    }
</script>